<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<link href="./css/modern.css" rel="stylesheet">
<link href="./css/style-student.css" rel="stylesheet" type="text/css">
</head>
<%
	String firstname = (String) request.getAttribute("firstname");
	String lastname = (String) request.getAttribute("lastname");
	String courseNumber = (String) request.getAttribute("courseNumber");
	String sectionNumber =  (String) request.getAttribute("sectionNumber");
	String division = (String) request.getAttribute("division");
	String COGSName = (String) request.getAttribute("COGSName");
%>
<script>
function validateTextFields()
{
	//Need to fix May validate at backend
/*
	for(var i =0; i<document.forms[0].length;i++)
	{
		var course = document.forms[0][i].value;
		
		if(course == "")
		{
			alert("Please fill in all Fields!!");
			return false;
		}
	}
	
	return true;
	*/
}

</script>
<body>
	<div id="container">
		<div id="header">
			<br>
			<h1 id="main-title">
				<b><font color="000000">EECE Student Group Assessments</b></font>
			</h1>
			<h2>
				Welcome!
			</h2>
			<h3 align="right">Logout</h3>
		</div>
		<div id="body">
		<div id="innerBody" class="page-region-content tiles">
			<br>
			<h1>TA Question Assignment</h1>
			<p>Please Select which TAs are available for this session and assign them a question.</p>
			<form name="form1" method="get" action ="ProfAddTADutyServlet" onsubmit = " return validateTextFields()">
			<%int i = 1; %>
			<c:forEach items="${TAInfo}" var="Info">
			<input type="checkbox" name="TA" value="${Info.TAID}">
			${Info.firstname} ${Info.lastname}:
			<p><input type="text" name="Questions${Info.TAID}"></p>
			<%i++;%>
			</c:forEach>
			<input type = "hidden" name = "firstname" value = <%=firstname%>>
			<input type = "hidden" name = "lastname" value = <%=lastname%>>	
			<input type = "hidden" name = "courseNumber" value = "<%=courseNumber%>">
			<input type = "hidden" name = "sectionNumber" value = <%=sectionNumber%>>
			<input type = "hidden" name = "size" value = <%=i%>>	
			<input type = "hidden" name = "COGSName" value = <%=COGSName%>>	
			<input type = "hidden" name = "division" value = <%=division%>>
			Each TA will be randomly assigned Students from each Group!
			<br><br><input type="submit" name="Submit" value="Assign Duties">
		  </form>
			<br>
			</div>
		</div>
						<div id="footer">
			&copy;UBC Electrical and Computer Engineering. Styled with <a
				href="http://metroui.org.ua">Metro UI CSS</a>
		</div>
	</div>
</body>
</html>